﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace SmartCity.ProcessEngine.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class db811501 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "InstanceModels",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    FormId = table.Column<long>(type: "bigint", nullable: false),
                    FormContent = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FlowStatus = table.Column<int>(type: "int", nullable: false),
                    StarterName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CurrentNodeId = table.Column<long>(type: "bigint", nullable: false),
                    CurrentNodeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CurrentOperatorName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NextNodeId = table.Column<long>(type: "bigint", nullable: false),
                    NextNodeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NextOperatorName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
                    Creator = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Updator = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_InstanceModels", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "InstanceRecardModels",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    IntanceId = table.Column<long>(type: "bigint", nullable: false),
                    NodeId = table.Column<long>(type: "bigint", nullable: false),
                    NodeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    OperatorName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    OperatorOpinion = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ApproveStatus = table.Column<int>(type: "int", nullable: false),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_InstanceRecardModels", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "InstanceModels");

            migrationBuilder.DropTable(
                name: "InstanceRecardModels");
        }
    }
}
